package com.leo;

import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;

/**
 * @ClassName Data
 * @Description
 * @Author wangss
 * @date 2020.06.17 22:49
 * @Version 1.0
 */
public class Data {

    private SimpleStringProperty name = new SimpleStringProperty();

    private SimpleIntegerProperty age = new SimpleIntegerProperty();

    private SimpleBooleanProperty flag = new SimpleBooleanProperty();

    public Data(String name, int age, boolean flag) {
        this.name.set(name);
        this.age.set(age);
        this.flag.set(flag);
    }

    public String getName() {
        return name.get();
    }

    public SimpleStringProperty nameProperty() {
        return name;
    }

    public void setName(String name) {
        this.name.set(name);
    }

    public int getAge() {
        return age.get();
    }

    public SimpleIntegerProperty ageProperty() {
        return age;
    }

    public void setAge(int age) {
        this.age.set(age);
    }

    public boolean isFlag() {
        return flag.get();
    }

    public SimpleBooleanProperty flagProperty() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag.set(flag);
    }

    @Override
    public String toString() {
        return "Data{" +
                "name=" + name +
                ", age=" + age +
                ", flag=" + flag +
                '}';
    }
}
